Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[f5_bigip_cookie_disclosure] Store cookies in the database #12217

Closed
wants to merge 14 commits into from
Closed

[f5_bigip_cookie_disclosure] Store cookies in the database #12217

wants to merge 14 commits into from

Conversation

SkypLabs
Copy link
Contributor

@SkypLabs SkypLabs commented Aug 20, 2019

Hi,

This PR follows the feature request #12187.

Additionally, the references have been updated and style issues have been fixed based on the output of rubocop.

Verification

  • Start msfconsole and make sure to use a database
  • use auxiliary/gather/f5_bigip_cookie_disclosure
  • set RHOSTS <vulnerable IP>
  • Verify that the module returns something like [+] F5 BigIP load balancing cookie...
  • notes and verify that the cookie name is stored in the notes

The cookie name, pool name and route domain are now stored in the
database as notes since they can contain useful recon information.

See #12187.
The metacharacter '\w' already contains numbers and underscores.
@SkypLabs SkypLabs changed the title Feature/store f5 cookies [f5_bigip_cookie_disclosure] Store cookies in the database Aug 20, 2019
@SkypLabs
Copy link
Contributor Author

@space-r7 The documentation has been added 👍

@space-r7 space-r7 added docs and removed needs-docs labels Aug 26, 2019
@h00die
Copy link
Contributor

h00die commented Oct 20, 2019

I'm happy with the docs, i'll leave it to someone @ r7 to see if they have access to a F5 to test the updates against.

Copy link
Contributor

@h00die h00die left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs look good to me

@SkypLabs
Copy link
Contributor Author

Hello,

Any news on this PR?

If you struggle getting your hands on an F5 BigIP, you can use Shodan or similar to find some online. The module will only collect and parse web cookies. Nothing harmful / illegal.

@ccondon-r7
Copy link
Contributor

Hey @h00die, this still in the works? Let us know if you want us to take over instead!

@h00die
Copy link
Contributor

h00die commented Feb 24, 2020

Yea I don't have that device or legal authority to use/scan one. You guys may have more luck

@ccondon-r7
Copy link
Contributor

Thanks, @h00die!

@bwatters-r7 bwatters-r7 added the needs-testing-environment PRs that need community testing and/or vulnerable test targets before they're able to be landed label Apr 2, 2020
@ccondon-r7
Copy link
Contributor

@SkypLabs we can't test this, unfortunately, so unless someone in the community has (legal) access to a device to test the module, we won't be able to merge it. We added our needs testing label in hopes of enlisting community help.

@smcintyre-r7
Copy link
Contributor

Since we can't merge this without testing it and we don't have access to (and legal authorization) for testing this vulnerability, I'm got to mark this as attic and close it out. If at a later point in time we can get a PCap, or access and authorization for testing we'd be happy to revisit it at that time.

Thanks alot for the contribution!

@smcintyre-r7 smcintyre-r7 added the attic Older submissions that we still want to work on again label Apr 13, 2020
@SkypLabs
Copy link
Contributor Author

Hi @ccondon-r7, @smcintyre-r7,

This is unfortunate but I understand the situation. I will try to get some evidence of the good functioning of my patch using a virtual appliance.

I will come back to you once done. Until then, stay safe!

@h00die
Copy link
Contributor

h00die commented Oct 19, 2020

@SkypLabs Must have missed your comment on the virtual appliance. I have one in my lab, but no idea how to configure it to be vulnerable. If you can provide some instructions on this, I can get it tested and landed!

@SkypLabs
Copy link
Contributor Author

SkypLabs commented Nov 7, 2020

@h00die Great! Let me check the documentation and I will come back to you with instructions. Many thanks for your help!

@SkypLabs
Copy link
Contributor Author

SkypLabs commented Nov 7, 2020

It seems that all you need is described on this page in the section "Creating a custom cookie persistence profile".

@h00die
Copy link
Contributor

h00die commented Nov 11, 2020

@SkypLabs I found my VM, its a completely default stock image. I set the cookie persistence profile exactly as the instructions said. Then I scanned the F5 web interface, but got "F5 BIG-IP load balancing cookie not found". I'm pretty sure I'm not supposed to scan the F5 web interface directly, however I don't know enough about the devices to know what i need to set up networking wise to make the cookie happen.
image

Any insight for me?

@h00die
Copy link
Contributor

h00die commented Nov 29, 2020

@SkypLabs any help?

@SkypLabs
Copy link
Contributor Author

Hey @h00die, sorry for the delay.

Indeed, you won't get the persistent cookies by scanning the admin interface. You need to create a target pool of web servers to process the HTTP incoming requests with your custom cookie persistence profile attached to it. Then, you need to create a virtual server which has the previous created pool as target. You will get the cookies by scanning the IP of the virtual server.

You will find step-by-step instructions in the same online documentation as the one you followed to create the cookie persistence profile.

Once again, many thanks for your precious help!

@h00die
Copy link
Contributor

h00die commented Jan 4, 2022

going through some backlog, i was able to verify this... yes, 1.5yrs later. I'll do some updates to the docs and such to get it back up to date for 2022

@h00die h00die reopened this Jan 4, 2022
@h00die
Copy link
Contributor

h00die commented Jan 4, 2022

https://github.com/SkypLabs/metasploit-framework/pull/2

@smcintyre-r7 smcintyre-r7 removed the attic Older submissions that we still want to work on again label Jan 4, 2022
f5 big-ip module and doc updates
@SkypLabs
Copy link
Contributor Author

SkypLabs commented Jan 5, 2022

Hi @h00die.

Many thanks for your help! I just merged your PR.

Let me know if you need me for anything.

@h00die
Copy link
Contributor

h00die commented Jan 8, 2022

https://www.shodan.io/search?query=%22Set-Cookie%3A+BIGipServer%22

msf6 auxiliary(gather/f5_bigip_cookie_disclosure) > run
[*] Running module against 111.111.111.111

[*] Starting request /
[+] F5 BIG-IP load balancing cookie "BIGipServer~thing~thing2~thing3 = rd1o00000000000000000000ffffac292158o73" found
[+] Load balancing pool name "~thing~thing2~thing3" found
[+] Route domain "1" found
[+] Backend 172.11.11.11:80 found
[*] Auxiliary module execution completed
msf6 auxiliary(gather/f5_bigip_cookie_disclosure) > notes

Notes
=====

 Time                     Host             Service  Port  Protocol  Type                           Data
 ----                     ----             -------  ----  --------  ----                           ----
 2022-01-08 17:20:21 UTC  111.111.111.111                           f5_load_balancer_cookie_name   "BIGipServer~thing~thing2~thing3"
 2022-01-08 17:20:21 UTC  111.111.111.111                           f5_load_balancer_pool_name     "~thing~thing2~thing3"
 2022-01-08 17:20:21 UTC  111.111.111.111                           f5_load_balancer_route_domain  "1"
 2022-01-08 17:20:21 UTC  111.111.111.111                           f5_load_balancer_backends      [{:host=>"172.11.11.11", :port=>80}]

working with the updates!

h00die added a commit that referenced this pull request Jan 8, 2022
@h00die
Copy link
Contributor

h00die commented Jan 8, 2022

Merged in 7b11429

@h00die
Copy link
Contributor

h00die commented Jan 8, 2022

Release Notes

This PR adds the f5 load balancer cookie to notes, and cleans up the module (rubocop/documentation/refs)

@h00die h00die closed this Jan 8, 2022
@SkypLabs
Copy link
Contributor Author

Great news. Thanks again @h00die.

@sjanusz-r7 sjanusz-r7 added the rn-modules release notes for new or majorly enhanced modules label Jan 14, 2022
@adfoster-r7 adfoster-r7 added rn-enhancement release notes enhancement and removed rn-modules release notes for new or majorly enhanced modules labels Jan 20, 2022
@SkypLabs SkypLabs deleted the feature/store-f5-cookies branch December 15, 2022 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module needs-testing-environment PRs that need community testing and/or vulnerable test targets before they're able to be landed rn-enhancement release notes enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants